package top.duduwy.model;

import lombok.Data;

@Data
public class RegionStats implements Comparable<RegionStats> {
    private String state;
    private String country;
    private int latestTotalCases;
    private int difFromPrevDay;

    @Override
    public int compareTo(RegionStats o) {
        //根据国家名称、省份/州排序
        if (!country.equals(o.country)) {
            return country.compareTo(o.country);
        } else {
            return state.compareTo(o.state);
        }
    }
}
